# coding=utf-8


class ItemModel(object):
    def __init__(self,index='0',
                 name='',
                 short_name='',
                 item_type='',
                 metadata='',
                 length='',
                 required='',
                 range_value='',
                 version='',
                 remark='',
                 items = None):
        self.index = index
        self.name = name
        self.short_name = short_name
        self.item_type = item_type
        self.metadata = metadata
        self.length = length
        self.required = required
        self.range_value = range_value
        self.version = version
        self.remark = remark
        if items is None:
            self.items = []
        else:
            self.items = items


    def is_model(self):
        return "List" == self.metadata or "Class" == self.metadata or "NullableClass" == self.metadata

    def is_busic_model(self):
        return len(self.items) > 0